<?php
$this->breadcrumbs=array(
	'Products',
);

$this->menu=array(
	array('label'=>'Create Product', 'url'=>array('create')),
	array('label'=>'Manage Product', 'url'=>array('admin')),
);
?>
<?php 

	$ready = <<<READY
	$("#product-statistics").css({"height":"120px","overflow":"hidden"});
	
	$("#product-show").toggle(function(){
		$("#product-statistics").css({"height":"auto"}).fadeIn('show');
	},function(){
		$("#product-statistics").css({"height":"120px","overflow":"hidden"});
	});
	
READY;

	$head = <<<HEAD

function func_update(id){
	var object = id.parent().siblings(".thumbnail");
	var src = id.attr("id");
	location.href=src;
}

function func_show(id){
	var object = id.parent().siblings(".thumbnail");
	var src = object.find("img").attr("src");
	src = src.replace('_thumb','');
	$.colorbox({href:src,slideshow:true, height:600});
	return false;
}

function func_showImg(id){

	var src = id.attr("name");

	title = id.attr("title");
	
	$.colorbox({href:src,title:title});
	return false;
}

HEAD;
?>
<?php Yii::app()->getClientScript()->registerScript('product-index-ready',$ready,CClientScript::POS_READY);?>
<?php Yii::app()->getClientScript()->registerScript('product-index-head',$head,CClientScript::POS_HEAD);?>

<div class="column1">
	<div class="box">
		<?php $this->beginWidget('zii.widgets.CPortlet', array('title'=>'Product Statistics',	));?>
			<div class="box-content">
				<ul id="product-statistics">
				<?php foreach ($catelist as $cate):?>
					<?php $this->renderPartial('_list',array('data'=>$cate));?>
				<?php endforeach;?>		
				</ul>
				<div style="text-align: right;"><a id="product-show" href="javascript:void();">显示所有分类</a></div>
			</div>
		<?php $this->endWidget();?>
	</div>		

	
	<?php $this->beginWidget('zii.widgets.CPortlet', array('title'=>'Product Statistics',	));?>
		
		<div style="text-align: right;"><a id="product-show" href="javascript:void();">显示所有分类</a></div>
		
	<?php $this->endWidget();?>	

</div>
<div class="column2">
	<div class="box">
		<?php $this->beginWidget('zii.widgets.CPortlet', array('title'=>'Products Info',	));?>
			<div class="box-content">
				<?php $this->widget('zii.widgets.CListView', array(
					'dataProvider'=>$dataProvider,
					'itemView'=>'_pview',
				)); ?>	
			</div>
			<hr class="space" />
		<?php $this->endWidget();?>
	</div>
	
</div>

<?php $this->widget('ext.box.colorbox.colorboxWidget',array(
		'id'=>'.various1',
		'theme'=>'example1',
//		'options'=>'width:"50%", inline:true, href:"#uploadbox",onClosed:function(){ load(); }'
));?> 
